package com.cscj.android.repository.db

import androidx.room.Database
import androidx.room.RoomDatabase
import androidx.room.TypeConverters
import com.cscj.android.repository.db.dao.BrowserHistoryDao
import com.cscj.android.repository.db.dao.FavoritesDao
import com.cscj.android.repository.db.dao.HotSearchDao
import com.cscj.android.repository.db.dao.SearchEngineDao
import com.cscj.android.repository.db.dao.SearchHistoryDao
import com.cscj.android.repository.db.dao.ShortCutDao
import com.cscj.android.repository.db.dao.UserAgentDao
import com.cscj.android.repository.db.entity.BrowseHistoryEntity
import com.cscj.android.repository.db.entity.FavoritesEntity
import com.cscj.android.repository.db.entity.HotSearchEntity
import com.cscj.android.repository.db.entity.SearchEngineEntity
import com.cscj.android.repository.db.entity.SearchHistoryEntity
import com.cscj.android.repository.db.entity.ShortCutCategoryEntity
import com.cscj.android.repository.db.entity.ShortCutEntity
import com.cscj.android.repository.db.entity.ShortCutEntryEntity
import com.cscj.android.repository.db.entity.UserAgentEntity

@Database(
    entities = [BrowseHistoryEntity::class, FavoritesEntity::class, SearchHistoryEntity::class, SearchEngineEntity::class, UserAgentEntity::class, HotSearchEntity::class, ShortCutCategoryEntity::class, ShortCutEntity::class, ShortCutEntryEntity::class],
    exportSchema = true,
    version = 3,
    autoMigrations = []
)
@TypeConverters(Converters::class)
abstract class CacheDatabase : RoomDatabase() {

    companion object {
        const val databaseName = "rocketBrowser"
    }

    abstract fun getSearchEngineDao(): SearchEngineDao

    abstract fun getUserAgentDao(): UserAgentDao

    abstract fun getBrowserHistoryDao(): BrowserHistoryDao

    abstract fun getFavoritesDao(): FavoritesDao


    abstract fun getSearchHistoryDao(): SearchHistoryDao

    abstract fun getHotSearchDao(): HotSearchDao

    abstract fun getShortCutDao(): ShortCutDao
}